using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ImageAnalystTools._MultidimensionalAnalysis
{
    /// <summary>
    /// <para>Generate Multidimensional Anomaly</para>
    /// <para>Computes the anomaly for each slice in an existing multidimensional raster to generate a new multidimensional raster.</para>
    /// <para>计算现有多维栅格中每个切片的异常情况，以生成新的多维栅格。</para>
    /// </summary>    
    [DisplayName("Generate Multidimensional Anomaly")]
    public class GenerateMultidimensionalAnomaly : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public GenerateMultidimensionalAnomaly()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_multidimensional_raster">
        /// <para>Input Multidimensional Raster</para>
        /// <para>The input multidimensional raster dataset.</para>
        /// <para>输入多维栅格数据集。</para>
        /// </param>
        /// <param name="_out_multidimensional_raster">
        /// <para>Output Multidimensional Raster</para>
        /// <para>The output Cloud Raster Format (CRF) multidimensional raster dataset.</para>
        /// <para>输出云栅格格式 （CRF） 多维栅格数据集。</para>
        /// </param>
        public GenerateMultidimensionalAnomaly(object _in_multidimensional_raster, object _out_multidimensional_raster)
        {
            this._in_multidimensional_raster = _in_multidimensional_raster;
            this._out_multidimensional_raster = _out_multidimensional_raster;
        }
        public override string ToolboxName => "Image Analyst Tools";

        public override string ToolName => "Generate Multidimensional Anomaly";

        public override string CallName => "ia.GenerateMultidimensionalAnomaly";

        public override List<string> AcceptEnvironments => ["cellSize", "compression", "configKeyword", "extent", "geographicTransformations", "nodata", "outputCoordinateSystem", "parallelProcessingFactor", "pyramid", "rasterStatistics", "resamplingMethod", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_multidimensional_raster, _out_multidimensional_raster, _variables, _method.GetGPValue(), _calculation_interval.GetGPValue(), _ignore_nodata.GetGPValue(), _reference_mean_raster];

        /// <summary>
        /// <para>Input Multidimensional Raster</para>
        /// <para>The input multidimensional raster dataset.</para>
        /// <para>输入多维栅格数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Multidimensional Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_multidimensional_raster { get; set; }


        /// <summary>
        /// <para>Output Multidimensional Raster</para>
        /// <para>The output Cloud Raster Format (CRF) multidimensional raster dataset.</para>
        /// <para>输出云栅格格式 （CRF） 多维栅格数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Multidimensional Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_multidimensional_raster { get; set; }


        /// <summary>
        /// <para>Variables [Dimension Info] (Description)</para>
        /// <para>The variable or variables for which anomalies will be calculated. If no variable is specified, all variables with a time dimension will be analyzed.</para>
        /// <para>将计算异常的一个或多个变量。如果未指定变量，则将分析具有时间维度的所有变量。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Variables [Dimension Info] (Description)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _variables { get; set; } = null;


        /// <summary>
        /// <para>Anomaly Calculation Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the method that will be used to calculate the anomaly.</para>
        ///   <bulletList>
        ///     <bullet_item>Difference From Mean—The difference between a pixel's value and the mean of that pixel's values across slices defined by the interval will be calculated. This is the default.</bullet_item><para/>
        ///     <bullet_item>Percent Difference From Mean—The percent difference between a pixel's value and the mean of that pixel's values across slices defined by the interval will be calculated.</bullet_item><para/>
        ///     <bullet_item>Percent Of Mean—The percent of the mean will be calculated.</bullet_item><para/>
        ///     <bullet_item>Z-score—The z-score for each pixel will be calculated. A z-score of 0 indicates the pixel's value is identical to the mean. A z-score of 1 indicates the pixel's value is 1 standard deviation from the mean. If a z-score is 2, the pixel's value is 2 standard deviations from the mean, and so on.</bullet_item><para/>
        ///     <bullet_item>Difference From Median—The difference between a pixel's value and the mathematical median of that pixel's values across slices defined by the interval will be calculated.</bullet_item><para/>
        ///     <bullet_item>Percent Difference From Median—The percent difference between a pixel's value and the mathematical median of that pixel's values across slices defined by the interval will be calculated.</bullet_item><para/>
        ///     <bullet_item>Percent Of Median—The percent of the mathematical median will be calculated.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于计算异常的方法。</para>
        ///   <bulletList>
        ///     <bullet_item>与平均值的差值—将计算像素值与该像素值在间隔定义的切片中的均值之间的差值。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>与平均值的百分比差异—将计算像素值与该像素值在间隔定义的切片中的平均值之间的百分比差异。</bullet_item><para/>
        ///     <bullet_item>均值百分比—将计算均值的百分比。</bullet_item><para/>
        ///     <bullet_item>Z 分数—将计算每个像素的 z 分数。z 分数为 0 表示像素的值与平均值相同。z 分数为 1 表示像素值与平均值相差 1 个标准差。如果 z 分数为 2，则像素值与平均值相差 2 个标准差，依此类推。</bullet_item><para/>
        ///     <bullet_item>与中位数的差值—将计算像素值与该像素值在区间定义的切片中的数学中位数之间的差值。</bullet_item><para/>
        ///     <bullet_item>与中位数的百分比差异 - 将计算像素值与该像素值在间隔定义的切片中的数学中位数之间的百分比差异。</bullet_item><para/>
        ///     <bullet_item>中位数百分比—将计算数学中位数的百分比。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Anomaly Calculation Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _method_value _method { get; set; } = _method_value._DIFFERENCE_FROM_MEAN;

        public enum _method_value
        {
            /// <summary>
            /// <para>Difference From Mean</para>
            /// <para>Difference From Mean—The difference between a pixel's value and the mean of that pixel's values across slices defined by the interval will be calculated. This is the default.</para>
            /// <para>与平均值的差值—将计算像素值与该像素值在间隔定义的切片中的均值之间的差值。这是默认设置。</para>
            /// </summary>
            [Description("Difference From Mean")]
            [GPEnumValue("DIFFERENCE_FROM_MEAN")]
            _DIFFERENCE_FROM_MEAN,

            /// <summary>
            /// <para>Percent Difference From Mean</para>
            /// <para>Percent Difference From Mean—The percent difference between a pixel's value and the mean of that pixel's values across slices defined by the interval will be calculated.</para>
            /// <para>与平均值的百分比差异—将计算像素值与该像素值在间隔定义的切片中的平均值之间的百分比差异。</para>
            /// </summary>
            [Description("Percent Difference From Mean")]
            [GPEnumValue("PERCENT_DIFFERENCE_FROM_MEAN")]
            _PERCENT_DIFFERENCE_FROM_MEAN,

            /// <summary>
            /// <para>Percent Of Mean</para>
            /// <para>Percent Of Mean—The percent of the mean will be calculated.</para>
            /// <para>均值百分比—将计算均值的百分比。</para>
            /// </summary>
            [Description("Percent Of Mean")]
            [GPEnumValue("PERCENT_OF_MEAN")]
            _PERCENT_OF_MEAN,

            /// <summary>
            /// <para>Z-score</para>
            /// <para>Z-score—The z-score for each pixel will be calculated. A z-score of 0 indicates the pixel's value is identical to the mean. A z-score of 1 indicates the pixel's value is 1 standard deviation from the mean. If a z-score is 2, the pixel's value is 2 standard deviations from the mean, and so on.</para>
            /// <para>Z 分数—将计算每个像素的 z 分数。z 分数为 0 表示像素的值与平均值相同。z 分数为 1 表示像素值与平均值相差 1 个标准差。如果 z 分数为 2，则像素值与平均值相差 2 个标准差，依此类推。</para>
            /// </summary>
            [Description("Z-score")]
            [GPEnumValue("Z_SCORE")]
            _Z_SCORE,

            /// <summary>
            /// <para>Difference From Median</para>
            /// <para>Difference From Median—The difference between a pixel's value and the mathematical median of that pixel's values across slices defined by the interval will be calculated.</para>
            /// <para>与中位数的差值—将计算像素值与该像素值在区间定义的切片中的数学中位数之间的差值。</para>
            /// </summary>
            [Description("Difference From Median")]
            [GPEnumValue("DIFFERENCE_FROM_MEDIAN")]
            _DIFFERENCE_FROM_MEDIAN,

            /// <summary>
            /// <para>Percent Difference From Median</para>
            /// <para>Percent Difference From Median—The percent difference between a pixel's value and the mathematical median of that pixel's values across slices defined by the interval will be calculated.</para>
            /// <para>与中位数的百分比差异 - 将计算像素值与该像素值在间隔定义的切片中的数学中位数之间的百分比差异。</para>
            /// </summary>
            [Description("Percent Difference From Median")]
            [GPEnumValue("PERCENT_DIFFERENCE_FROM_MEDIAN")]
            _PERCENT_DIFFERENCE_FROM_MEDIAN,

            /// <summary>
            /// <para>Percent Of Median</para>
            /// <para>Percent Of Median—The percent of the mathematical median will be calculated.</para>
            /// <para>中位数百分比—将计算数学中位数的百分比。</para>
            /// </summary>
            [Description("Percent Of Median")]
            [GPEnumValue("PERCENT_OF_MEDIAN")]
            _PERCENT_OF_MEDIAN,

        }

        /// <summary>
        /// <para>Mean Calculation Interval</para>
        /// <para><xdoc>
        ///   <para>Specifies the temporal interval that will be used to calculate the mean.</para>
        ///   <bulletList>
        ///     <bullet_item>All—The mean is calculated across all slices for each pixel.</bullet_item><para/>
        ///     <bullet_item>Yearly—The yearly mean is calculated for each pixel.</bullet_item><para/>
        ///     <bullet_item>Recurring monthly—The monthly mean is calculated for each pixel.</bullet_item><para/>
        ///     <bullet_item>Recurring weekly—The weekly mean is calculated for each pixel.</bullet_item><para/>
        ///     <bullet_item>Recurring daily—The daily mean is calculated for each pixel.</bullet_item><para/>
        ///     <bullet_item>Hourly—The hourly mean is calculated for each pixel.</bullet_item><para/>
        ///     <bullet_item>External raster—An existing raster dataset that contains the mean or median value for each pixel is referenced.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于计算平均值的时间间隔。</para>
        ///   <bulletList>
        ///     <bullet_item>全部 - 计算每个像素的所有切片的平均值。</bullet_item><para/>
        ///     <bullet_item>每年 - 计算每个像素的年平均值。</bullet_item><para/>
        ///     <bullet_item>每月重复 - 计算每个像素的月平均值。</bullet_item><para/>
        ///     <bullet_item>每周重复 - 计算每个像素的每周平均值。</bullet_item><para/>
        ///     <bullet_item>每日重复 - 计算每个像素的每日平均值。</bullet_item><para/>
        ///     <bullet_item>每小时 - 计算每个像素的每小时平均值。</bullet_item><para/>
        ///     <bullet_item>外部栅格 - 将引用包含每个像素的平均值或中值的现有栅格数据集。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Mean Calculation Interval")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _calculation_interval_value _calculation_interval { get; set; } = _calculation_interval_value._ALL;

        public enum _calculation_interval_value
        {
            /// <summary>
            /// <para>All</para>
            /// <para>All—The mean is calculated across all slices for each pixel.</para>
            /// <para>全部 - 计算每个像素的所有切片的平均值。</para>
            /// </summary>
            [Description("All")]
            [GPEnumValue("ALL")]
            _ALL,

            /// <summary>
            /// <para>Yearly</para>
            /// <para>Yearly—The yearly mean is calculated for each pixel.</para>
            /// <para>每年 - 计算每个像素的年平均值。</para>
            /// </summary>
            [Description("Yearly")]
            [GPEnumValue("YEARLY")]
            _YEARLY,

            /// <summary>
            /// <para>Recurring monthly</para>
            /// <para>Recurring monthly—The monthly mean is calculated for each pixel.</para>
            /// <para>每月重复 - 计算每个像素的月平均值。</para>
            /// </summary>
            [Description("Recurring monthly")]
            [GPEnumValue("RECURRING_MONTHLY")]
            _RECURRING_MONTHLY,

            /// <summary>
            /// <para>Recurring weekly</para>
            /// <para>Recurring weekly—The weekly mean is calculated for each pixel.</para>
            /// <para>每周重复 - 计算每个像素的每周平均值。</para>
            /// </summary>
            [Description("Recurring weekly")]
            [GPEnumValue("RECURRING_WEEKLY")]
            _RECURRING_WEEKLY,

            /// <summary>
            /// <para>Recurring daily</para>
            /// <para>Recurring daily—The daily mean is calculated for each pixel.</para>
            /// <para>每日重复 - 计算每个像素的每日平均值。</para>
            /// </summary>
            [Description("Recurring daily")]
            [GPEnumValue("RECURRING_DAILY")]
            _RECURRING_DAILY,

            /// <summary>
            /// <para>Hourly</para>
            /// <para>Hourly—The hourly mean is calculated for each pixel.</para>
            /// <para>每小时 - 计算每个像素的每小时平均值。</para>
            /// </summary>
            [Description("Hourly")]
            [GPEnumValue("HOURLY")]
            _HOURLY,

            /// <summary>
            /// <para>External raster</para>
            /// <para>External raster—An existing raster dataset that contains the mean or median value for each pixel is referenced.</para>
            /// <para>外部栅格 - 将引用包含每个像素的平均值或中值的现有栅格数据集。</para>
            /// </summary>
            [Description("External raster")]
            [GPEnumValue("EXTERNAL_RASTER")]
            _EXTERNAL_RASTER,

        }

        /// <summary>
        /// <para>Ignore NoData</para>
        /// <para><xdoc>
        ///   <para>Specifies whether NoData values are ignored in the analysis.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The analysis will include all valid pixels along a given dimension and ignore any NoData pixels. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The analysis will result in NoData if there are any NoData values for the pixels along the given dimension.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否在分析中忽略 NoData 值。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 分析将包括给定维度上的所有有效像素，并忽略任何 NoData 像素。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 如果给定维度上的像素有任何 NoData 值，则分析将生成 NoData。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Ignore NoData")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _ignore_nodata_value _ignore_nodata { get; set; } = _ignore_nodata_value._true;

        public enum _ignore_nodata_value
        {
            /// <summary>
            /// <para>DATA</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DATA")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NODATA</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NODATA")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Input External Raster</para>
        /// <para>The reference raster dataset that contains a previously calculated mean for each pixel. The anomalies will be calculated in comparison to this mean.</para>
        /// <para>包含先前计算的每个像素的平均值的参考栅格数据集。将根据此平均值计算异常。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input External Raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _reference_mean_raster { get; set; } = null;


        public GenerateMultidimensionalAnomaly SetEnv(object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object nodata = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object pyramid = null, object rasterStatistics = null, object resamplingMethod = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, nodata: nodata, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, pyramid: pyramid, rasterStatistics: rasterStatistics, resamplingMethod: resamplingMethod, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}